package com.basic;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class TestStringContext {
    public static void main(String[] args) {


        ArrayList<Integer> dataList = new ArrayList<>();

        for (int i=0;i<202;i++){
            dataList.add(i+1);
        }
        for (int i=0;i<dataList.size();i++){
            System.out.println("="+dataList.get(i));
        }
        Map<String,List<Integer>> countListMap = new HashMap<>();
        //分组数
        int groupVal =20;
        int sumVal = dataList.size();
        int groupSum= sumVal/groupVal;
        int yuVal= 0;
        if(sumVal%groupVal>0){
            yuVal=sumVal%groupVal;
            groupSum++;
        }
        System.out.println("groupVal=="+groupVal);
        System.out.println("sumVal=="+sumVal);
        System.out.println("groupSum=="+groupSum);
        for(int i=1;i<groupSum;i+=groupVal){
            List<Integer> newList = dataList.subList(i,groupVal);
            countListMap.put("fz"+groupSum,newList);
            if(i<groupSum){
                groupVal+=20;
            }else {
                groupVal+=yuVal;
            }
        }
        //分组后的结果
        for (int i=0;i<groupSum;i++){
            List<Integer> newList =  countListMap.get("fz"+groupSum);
            for(int t =0;t<newList.size();t++){
                System.out.print("=="+dataList.get(t));
            }
            //换行
            System.out.println();
        }

    }
}
